﻿using Avalonia.WebView.Linux;
using Avalonia.WebView.Windows;
using System.Runtime.InteropServices;

namespace Avalonia.WebView.Desktop
{
    public static class AppBuilderExtensions
    {
        public static AppBuilder UseDesktopWebView(this AppBuilder builder)
        {
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                builder.UseWindowsWebView();
            }
            else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
            {
                builder.UseLinuxWebView();
            }

            return builder;

        }
    }
}
